import request from '@/utils/request'

// 查询会话列表
export function listSession(query) {
  return request({
    url: '/system/session/list',
    method: 'get',
    params: query
  })
}

// 查询会话详细
export function getSession(id, params) {
  return request({
    url: "/system/session/" + id,
    method: "get",
    params
  });
}

// 新增会话
export function addSession(data) {
  return request({
    url: '/system/session',
    method: 'post',
    data: data
  })
}

// 修改会话
export function updateSession(data) {
  return request({
    url: '/system/session',
    method: 'put',
    data: data
  })
}

// 删除会话
export function delSession(id) {
  return request({
    url: '/system/session/' + id,
    method: 'delete'
  })
}



// 获取未读会话数据
export const getUnreadInfoListApi = (params, data) => request({ url: `/web/session/getUnreadInfoList`, method: 'post', params, data })

// 获取未读会话数据 (自己)
export const getSendingUnreadInfoListApi = (params, data) => request({ url: `/web/session/getSendingUnreadInfoList`, method: 'post', params, data })